Bookmark
Python API - LLM
https://llm.datasette.io/en/stable/python-api.html, posted Jul '23 by peter in ai development free python software
LLM provides a Python API for executing prompts, in addition to the command-line interface.
[...]
To run a prompt against the
gpt-3.5-turbo
model, run this:import llm model = llm.get_model("gpt-3.5-turbo") model.key = 'YOUR_API_KEY_HERE' response = model.prompt("Five surprising names for a pet pelican") print(response.text())